def solution(nums1: list, nums2: list) -> bool:
    for i in nums1:
        for j in nums2:
            if i == j:
                return True
    return False


if __name__ == '__main__':
    assert solution([9, 8, 7], [8, 1, 3]) == True
    assert solution([1, 2, 3, 4, 5], [1, 6, 7, 8, 9]) == True
    assert solution([1, 3, 5], [2, 4, 6]) == False
